home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / dbase / vpi1_330.zip / RELATION.PRG < prev    next >
Text File  |  1991-12-30  |  2KB  |  45 lines

  1. **********************************************************************
  2. **  RELATION.PRG
  3. **  (C) Copyright 1990-92, Sub Rosa Publishing Inc.
  4. **
  5. **  A demonstration program provided to VP-Info users.
  6. **  This program may be copied freely. If it is used in commercial code,
  7. **  please credit the source, Sub Rosa Publishing Inc.
  8. **
  9. **  RELATION demonstrates use of two related data files and the
  10. **  FIND command
  11. **
  12. **  RELATION is compatible with all current versions of VP-Info.
  13. **
  14. **  MASTRAN and CUSTLIST are both indexed on the customer number.
  15. **  A record is found in MASTRAN by having the user enter a customer
  16. **  number into FINDER.  If a matching record is found, # will equal
  17. **  :NEAR, but if not, the program positions on :NEAR, the first record
  18. **  greater than the FIND key.
  19. **
  20. **  During BROWSE, every time a new record is shown, the matching
  21. **  record in CUSTLIST is shown as well and, if changed, updates
  22. **  the contents of CUSTLIST.
  23. **
  24. **  Sid Bursten and Bernie Melman
  25. **********************************************************************
  26. SET talk off
  27. USE mastran index mastran
  28. USE#2 custlist index custlist
  29. SET relation on cust_no to 2
  30. DO WHILE t
  31.    CLS
  32.    ACCEPT 'Enter a customer number (leave blank to quit). . . ' to finder
  33.    IF finder=' '
  34.       BREAK
  35.    ENDIF
  36.    FIND &finder
  37.    IF #<>:NEAR              ;:NEAR equals record number if successful
  38.       GOTO :NEAR
  39.    ENDIF
  40.    BROWSE cust_no,amount,dayout,cust_no#2,fname#2,name#2,address#2,city#2
  41. ENDDO
  42. CHAIN samples
  43. *
  44. *                 *** end of program RELATION.PRG ***
  45.